Filtering huge amounts of data in a short time is often required for example when filtering data streams used in computer networking devices such as routers, network switches or firewalls. For example, when a network switch receives a data frame at one of its ports, the data filtering routine may include that the network switch updates an internal table with the source address of the frame and the port it was received on, looks up the destination address in the table to determine what port the frame needs to be forwarded to, and sends it out on that port.
This example of a high speed searching application may be implemented using dedicated hardware-accelerated devices such as content-addressable memories (CAM) instead of common memory devices such as for example random access memory devices and for example general purpose processors. Unlike for example random access memory devices where a user supplies a memory address and the memory returns a data word stored at the supplied address, a CAM only receives the data word. The CAM then searches its content and if the data word is found, the CAM returns one or more addresses where the data word was found. A ternary CAM may allow matching states “1”, “0” and a third matching state of “X” or “Care/Don't Care” for one or more bits in the stored data word. This feature can be implemented by for example providing each individual memory bit in a CAM with a dedicated comparison circuit to detect a match between the stored bit and the input bit and combining their match outputs to yield a complete data word match. This circuitry increases the physical size of the CAM chip and therefore device costs and power consumption.